<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet"
          href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
          crossorigin="anonymous">
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <ul style="list-style: decimal">
                <?php getFileOrDic(dirname(__FILE__)) ?>
            </ul>
        </div>
    </div>
</div>
</body>
</html>
<?php
function getFileOrDic($path)
{
    $opendir = opendir($path);
    $filess = [];
    while ($file = readdir($opendir)) {
        $dir = is_dir($file) ? 'text-danger' : '';
        if ($file !== '.' && $file !== '..' && $file[0] !== '.') {
            $access = date('Y-m-d H:i:s', filectime($file));
            echo "<li class='h4'><a class='{$dir}' href='{$file}' >{$file}<small class='pull-right'>{$access}</small></a></li>";
        }
    }
}
